; Master variables
masterSourceLoc = http://contextype.googlecode.com/svn/release/


; This script:
; 1. Verifies that the proper .NET framework is installed on the system
; 2. Installs the three CType files in the local folder (if step 1 is OK).

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; Hide AHK icon
Menu, Tray, NoIcon

; --- Step 1: Verify that the proper version of .NET framework exists on system ---
IfNotExist, C:\Windows\Microsoft.NET\Framework\v4.0.30319\
{
	MsgBox, You do not have the proper .NET framework (version 4.0.30319) installed.
	ExitApp
}

; --- Step 2: Download the relevant files ---
downloadSuccesses := 0
UrlDownloadToFile, %masterSourceLoc%/ContexType.exe, ContexType.exe
IfExist, ContexType.exe
	downloadSuccesses += 1

UrlDownloadToFile, %masterSourceLoc%/ContexType.pdb, ContexType.pdb
IfExist, ContexType.pdb
	downloadSuccesses += 1

UrlDownloadToFile, %masterSourceLoc%/ContexType.xml, ContexType.xml
IfExist, ContexType.xml
	downloadSuccesses += 1

; --- Step 3: Report results to the user ---
MsgBox, %downloadSuccesses% of 3 files downloaded successfully.